
testOptimizations([
	['a(!false)',	'a(true);'],
	['a(!true)',	'a(false);'],
	['a(!!false)',	'a(false);'],
	['a(!!true)',	'a(true);'],
	
	['a(!0)',		'a(true);'],
	['a(!1)',		'a(false);'],
	
	['a(!x)',		'a(!x);'],
	
	['a(!null)',	'a(true);'],
	['a(!{})',		'a(false);'],
	['a(![])',		'a(false);'],
	
	// should maintain conversion to Boolean:
	['a(!!x)',		'a(!!x);'],
	
	// should simplify operators:
	['!!x ? a() : b()',
		'x ? a() : b();'],
	['if (!!x) throw 1',
		'if (x) throw 1;'],
	['while (!!x) call()',
		'while (x) call();'],
	['do call(); while (!!x)',
		'do call(); while (x);'],
	['for (;!!x;) throw call()',
		'for ( ; x; ) throw call();'],
	
	// should negate the expression inside:
	['a(!(x == y));',
		'a(x != y);'],
	['a(!(x === y));',
		'a(x !== y);'],
	['a(!(x != y));',
		'a(x == y);'],
	['a(!(x !== y));',
		'a(x === y);'],
	
	// the negations should be removed completely because the operator inside always has a boolean result; test just a few of the ops
	['a(!!(x < y));',
		'a(x < y);'],
	['a(!!(x <= y));',
		'a(x <= y);'],
	['a(!!(x == y));',
		'a(x == y);'],
	['a(!!(x === y));',
		'a(x === y);']
]);
